//
//  ConstractDetailModel.m
//  SAP
//
//  Created by 中矿科技有限公司 on 17/9/13.
//  Copyright © 2017年 中矿科技有限公司. All rights reserved.
//

#import "ConstractDetailModel.h"

@implementation ConstractDetailModel


-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
}

+(ConstractDetailModel *)getGetOptionsDetailfromData:(NSData *)data{
    NSDictionary *dict =[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
    ConstractDetailModel *model =[[ConstractDetailModel alloc]init];
    if (![dict[@"result"] isKindOfClass:[NSDictionary class]]) {
        return model;
    }
    if (![dict[@"result"][@"data"] isKindOfClass:[NSDictionary class]]) {
        return model;
    }

    model =[ConstractDetailModel mj_objectWithKeyValues:dict[@"result"][@"data"]];

    
    return model;
}

+(NSDictionary *)getGetOptionsDetailDictfromData:(NSData *)data{
    NSDictionary *dict =[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
    NSDictionary *dict1 =[[NSDictionary alloc]init];
    if (![dict[@"result"] isKindOfClass:[NSDictionary class]]) {
        return dict1;
    }
    if (![dict[@"result"][@"data"] isKindOfClass:[NSDictionary class]]) {
        return dict1;
    }
    
   return dict[@"result"][@"data"];
    
}


@end


@implementation SAflowInstanceHistoryList


//+ (NSDictionary *)mj_objectClassInArray
//{
//    return @{
//             @"flowInstanceHistoryList" : @"SAflowInstanceHistoryList",
//             };
//}

-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
}

+(NSArray *)getOptionsFlowDetailfromData:(NSData *)data{
    NSDictionary *dict =[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
    NSMutableArray *result =[NSMutableArray array];
    if (![dict[@"result"] isKindOfClass:[NSDictionary class]]) {
        return result;
    }
    if (![dict[@"result"][@"flowInstanceHistoryList"] isKindOfClass:[NSArray class]]) {
        return result;
    }
    for (NSDictionary * typeDict in dict[@"result"][@"flowInstanceHistoryList"] ) {
        SAflowInstanceHistoryList *model =[SAflowInstanceHistoryList mj_objectWithKeyValues:typeDict];
        [result addObject:model];
    }
    
    return result;
}

@end

//下方按钮
@implementation SAActionList
+(NSArray *)getOptionsAcstionListfromData:(NSData *)data{
    NSDictionary *dict =[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
    NSMutableArray *result =[NSMutableArray array];
    if (![dict[@"result"] isKindOfClass:[NSDictionary class]]) {
        return result;
    }
    if (![dict[@"result"][@"actionList"] isKindOfClass:[NSArray class]]) {
        return result;
    }
    for (NSDictionary * typeDict in dict[@"result"][@"actionList"] ) {
        SAActionList *model =[SAActionList mj_objectWithKeyValues:typeDict];
        [result addObject:model];
    }
    
    return result;
}

@end

@implementation SANextNodeUserList

+ (NSDictionary *)mj_replacedKeyFromPropertyName
{
    return @{
             @"Id" : @"id",
             };
}
+(NSArray *)getOptionsNextNodeUserListfromData:(NSData *)data{
    NSDictionary *dict =[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
    NSMutableArray *result =[NSMutableArray array];
    if (![dict[@"result"] isKindOfClass:[NSDictionary class]]) {
        return result;
    }
    if (![dict[@"result"][@"nextNodeUserList"] isKindOfClass:[NSArray class]]) {
        return result;
    }
    for (NSDictionary * typeDict in dict[@"result"][@"nextNodeUserList"] ) {
        SANextNodeUserList *model =[SANextNodeUserList mj_objectWithKeyValues:typeDict];
        [result addObject:model];
    }
    
    return result;
}
@end

@implementation SAContract

+ (NSDictionary *)mj_replacedKeyFromPropertyName
{
    return @{
             @"Id" : @"id",
             };
}

@end

@implementation SAReceipt


@end

@implementation SASellerOrBuyer


@end

@implementation SAProvision


@end
